package com.zyh.service;

import com.zyh.Repository.ESchoolRepository;
import com.zyh.entity.EnterSchool;
import com.zyh.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ESchoolService {
    @Autowired
    ESchoolRepository eSchoolRepository;

    public List<EnterSchool> findAllESchool(){

        return eSchoolRepository.findAll();
    }

    public EnterSchool save(EnterSchool enterSchool){
        return eSchoolRepository.save(enterSchool);
    }

    public List<EnterSchool> findAllBySno(int sno) {
        return eSchoolRepository.findAllBySno(sno);
    }

    public List<EnterSchool> findAllBySname(String sname) {
        return eSchoolRepository.findAllBySname(sname);
    }
}
